A Trip Down Memory Lane in Haskell
نویسندگان
چکیده
While writing a compiler in Haskell, we had a problem with a large memory usage. We show how, by changing only a few small aspects of our design, we were able to reduce the live memory use of our program from 650 megabytes down to a mere 10 megabytes. We examine the aspects of our program that caused this problem: the writer monad and generic programming. We conclude that Haskell is a powerful, useful and fun programming language, but that programmers must remain careful as to which techniques they choose to use, and must keep a close eye on their memory profile throughout the development process.
منابع مشابه
Multigrid convergence: a brief trip down memory lane
Wemake a brief algebraic survey of the highlights of the classical convergence theory for multigrid methods, in particular, the multigrid V-cycle.
متن کاملTowards a Verified Implementation of Software Transactional Memory
In recent years there has been much interest in the idea of concurrent programming using transactional memory, for example as provided in STM Haskell. While programmers are provided with a simple high-level model of transactions in terms of a stop-the-world semantics, the low-level implementation is rather more complex, using subtle optimisation techniques to execute multiple concurrent transac...
متن کاملNhc: a Space-eecient Haskell Compiler
Self-compiling implementations of Haskell, i.e., those written in Haskell, have been and, except one, are still space consuming monsters. Object code size for the compilers themselves are 3-8 Mbyte, and they need 12-20 Mbyte to recompile themselves. One reason for the huge demands for memory is that the main goal for these compilers is to produce fast code. However, the compiler described in th...
متن کاملImplementing Software Transactional Memory, Correctly
In recent years there has been much interest in the idea of concurrent programming using transactional memory, for example as provided in STM Haskell. While programmers are provided with a simple high-level model of transactions in terms of a stop-the-world semantics, the low-level implementation is rather more complex, involving subtle techniques that allow multiple transactions to execute con...
متن کاملEnvironmental impact assessment of bus rapid transit (BRT) in the Metropolitan City of Tehran
Bus rapid transit is an innovative, high capacity, lower cost public transit solution in metropolitan cities. Idea is to dedicate lanes for quick and efficient transport of passengers to their destinations. In the present investigation the environmental impact assessment of bus rapid transit in Tehran metropolitan city is brought out. For this purpose bus rapid transit Lane No. 10 is investiga...
متن کامل